package com.bioroadlab.pojo;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

@Entity
@Table(name = "disease", catalog = "bioroadlab")
public class Disease implements java.io.Serializable {

	private static final long serialVersionUID = 1L;

	private Integer sn;
	private DiseaseType diseaseType;
	private String name;
	private String englishAlias;
	private String alias;
	private String shortName;
	private String description;
	private String incidence;
	private String relativity;
	private String code;
	private String abbreviation;
	private String editor;
	private String englishName;
	private Integer status;
	private Integer parent;
	private Timestamp editTime;
	private BigDecimal avg1;
	private BigDecimal avg2;
	private BigDecimal diseaseRatio;
	private Set<DiseaseTestObjectRel> diseaseTestObjectRels = new HashSet<DiseaseTestObjectRel>(
			0);
	private Set<DiseaseKeyword> diseaseKeywords = new HashSet<DiseaseKeyword>(0);
	private Set<TestItem> testItems = new HashSet<TestItem>(0);

	// Property accessors
	@TableGenerator(table = "id_generator", name = "generator", pkColumnName = "name", pkColumnValue = "Disease", valueColumnName = "id", initialValue = 1, allocationSize = 1)
	@Id
	@GeneratedValue(generator = "generator", strategy = GenerationType.TABLE)
	@Column(name = "sn", unique = true, nullable = false)
	public Integer getSn() {
		return this.sn;
	}

	public void setSn(Integer sn) {
		this.sn = sn;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "type", nullable = false)
	public DiseaseType getDiseaseType() {
		return this.diseaseType;
	}

	public void setDiseaseType(DiseaseType diseaseType) {
		this.diseaseType = diseaseType;
	}

	@Column(name = "name", length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "english_alias", length = 500)
	public String getEnglishAlias() {
		return this.englishAlias;
	}

	public void setEnglishAlias(String englishAlias) {
		this.englishAlias = englishAlias;
	}

	@Column(name = "alias")
	public String getAlias() {
		return this.alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	@Column(name = "short_name", length = 50)
	public String getShortName() {
		return this.shortName;
	}

	public void setShortName(String shortName) {
		this.shortName = shortName;
	}

	@Column(name = "description", length = 65535)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "incidence", length = 40)
	public String getIncidence() {
		return this.incidence;
	}

	public void setIncidence(String incidence) {
		this.incidence = incidence;
	}

	@Column(name = "relativity", length = 20)
	public String getRelativity() {
		return this.relativity;
	}

	public void setRelativity(String relativity) {
		this.relativity = relativity;
	}

	@Column(name = "code", length = 50)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "abbreviation", length = 20)
	public String getAbbreviation() {
		return this.abbreviation;
	}

	public void setAbbreviation(String abbreviation) {
		this.abbreviation = abbreviation;
	}

	@Column(name = "editor", length = 50)
	public String getEditor() {
		return this.editor;
	}

	public void setEditor(String editor) {
		this.editor = editor;
	}

	@Column(name = "english_name", length = 500)
	public String getEnglishName() {
		return this.englishName;
	}

	public void setEnglishName(String englishName) {
		this.englishName = englishName;
	}

	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "parent")
	public Integer getParent() {
		return this.parent;
	}

	public void setParent(Integer parent) {
		this.parent = parent;
	}

	@Column(name = "edit_time", length = 19)
	public Timestamp getEditTime() {
		return this.editTime;
	}

	public void setEditTime(Timestamp editTime) {
		this.editTime = editTime;
	}

	@Column(name = "avg1", precision = 10)
	public BigDecimal getAvg1() {
		return this.avg1;
	}

	public void setAvg1(BigDecimal avg1) {
		this.avg1 = avg1;
	}

	@Column(name = "avg2", precision = 10, scale = 1)
	public BigDecimal getAvg2() {
		return this.avg2;
	}

	public void setAvg2(BigDecimal avg2) {
		this.avg2 = avg2;
	}

	@Column(name = "disease_ratio", precision = 8)
	public BigDecimal getDiseaseRatio() {
		return this.diseaseRatio;
	}

	public void setDiseaseRatio(BigDecimal diseaseRatio) {
		this.diseaseRatio = diseaseRatio;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "disease")
	public Set<DiseaseTestObjectRel> getDiseaseTestObjectRels() {
		return this.diseaseTestObjectRels;
	}

	public void setDiseaseTestObjectRels(
			Set<DiseaseTestObjectRel> diseaseTestObjectRels) {
		this.diseaseTestObjectRels = diseaseTestObjectRels;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "diseases")
	public Set<DiseaseKeyword> getDiseaseKeywords() {
		return this.diseaseKeywords;
	}

	public void setDiseaseKeywords(Set<DiseaseKeyword> diseaseKeywords) {
		this.diseaseKeywords = diseaseKeywords;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "diseases")
	public Set<TestItem> getTestItems() {
		return this.testItems;
	}

	public void setTestItems(Set<TestItem> testItems) {
		this.testItems = testItems;
	}

}